import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Tests {
    public static void main1(String[] args) {
        Scanner scan = new Scanner(System.in);
        int year = scan.nextInt();
        int Feb = 0;
        if(year%4==0&&year%100!=0||year%400==0){
            Feb = 29;
        }else{
            Feb = 28;
        }
        System.out.println(Feb);
    }
    public static void main2(String[] args) {
        Scanner scan = new Scanner(System.in);
        int year = scan.nextInt();
        int month = scan.nextInt();
        int day = scan.nextInt();
        int Feb = 0;
        int[] a = new int[]{1,3,5,7,8,10,12};
        if(year%4==0&&year%100!=0||year%400==0){
            Feb = 29;
        }else{
            Feb = 28;
        }
        int fate = 0;
        int count = 0;
        for(int i = 0;i < a.length;i++){
            if(month>a[i]){
                count++;
            }

        }

        System.out.println(Feb+count*31+(month-count-2)*30+day);
    }

    public static void main3(String[] args) {

        Scanner scan = new Scanner(System.in);
        int a = 4;
        String str = "0123456789ABCDEF";
        List<Character> list = new ArrayList<>();
        while(a != 0){
            list.add(str.charAt(a%2));
            a = a/2;
        }
        int count = 0;
        for(int i = 0;i< list.size();i++){
            if(list.get(i)=='1'){
                count++;
            }
        }
        System.out.println(count);
    }

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int a = 1000;
        int count= 0;
        for(int i = 1;i < a+1; i++){
            int b = 0;
            for (int j = 1; j <= i /2+1; j++) {
                if ((i % j) == 0) {
                    b += j;
                }
            }
            if(b == i){
                count++;
            }
        }
        System.out.println(count-1);
    }
}
